Inspiratory airway pressure system with admittance determining apparatus and method

ABSTRACT

An apparatus and method for facilitating the respiration of a patient are disclosed which are particularly useful in treating mixed and obstructive sleep apnea and certain cardiovascular conditions, among others, by increasing nasal air pressure delivered to the patient&#39;s respiratory passages just prior to inhalation and by subsequently decreasing the pressure to ease exhalation effort. The preferred apparatus includes a patient-coupled gas delivery device for pressurizing the patient&#39;s nasal passages at a controllable pressure, and a controller coupled with the delivery device having a pressure transducer for monitoring the nasal pressure and a microcontroller for selectively controlling the nasal pressure. In operation, the controller determines a point in the patient breathing cycle just prior to inhalation and initiates an increase in nasal pressure at that point in order to stimulate normal inhalation, and subsequently lowers the nasal pressure to ease exhalation efforts.

This aplication is continuation-in-part of Ser. No. 07/518,001 filed May2, 1990, now abandoned, which was a continuation-in-part of Ser. No.07/513,757, filed Apr. 24, 1990, now abandoned, which was acontinuation-in-part of Ser. No. 07/354,143 filed May 19, 1989, nowabandoned.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to an apparatus and method forfacilitating the respiration of a patient and is particularly useful intreating disturbed breathing, snoring, mixed obstructive sleep apnea,and certain cardiovascular sleep conditions. More particularly, thepresent invention is concerned with an apparatus and method for imposinga positive pressure on the patient's airways just prior to the onset ofinhalation in order to induce and/or permit inhalation, and forsubsequently reducing the pressure on the airways to ease exhalationeffort. Another aspect of the invention is concerned with monitoringsounds associated with patient's respiration and controlling the gaspressure delivered to the patient's respiratory passages in accordancewith the sounds.

2. Description of the Prior Art

Obstructive sleep apnea is a sleep disorder characterized by relaxationof the airway including the genioglossus throat muscle tissue duringsleep. When this occurs, the relaxed muscle can partially or completelyblock the patient's airway, a condition more prevalent in overweightpatients. Partial blockage can result in snoring. Complete blockage canresult in sleep apnea.

When complete blockage occurs, the patient's inhalation efforts do notresult in the intake of air and the patient becomes oxygen deprived. Inreaction, the patient begins to awaken. Upon reaching a nearly awakenedstate, the genioglossus muscle resumes normal tension which clears theairway and allows inhalation to occur. The patient then falls back to adeeper sleep wherupon the genioglossus muscle again relaxes and theapneic cycle repeats.

Central apnea is when no inspiratory effort ocurs or is delayed. Centralapnea may be combined with obstructive apnea, known as mixed apnea.Other breathing irregularities such as Cheynes Stockes breathing mayhave apneic intervals when intake airflow ceases.

In some patients, sleep apnea events can occur dozens of times duringthe course of a sleep session. In consequence, the patient neverachieves a full relaxed, deep sleep session because of the repetitivearousal to a nearly awakened state. The patient is also deprived of REM(rapid eye movement) sleep. People afflicted with sleep apnea arecontinually tired even after an apparently normal night's sleep.

In order to treat obstructive sleep apnea, the so-called continuouspositive airway pressure (CPAP) system hasd been devised in which aprescribed level of positive airway pressure is continuously imposed onthe patient's airways. The presence of such positive pressure on theairways provides a pressure splint to offset the negative inspiratorypressure to maintain tissue position tension and thereby maintain anopen patient airway. The positive airway connection with a patient istypically achieved by way of a nasal pillow such as that disclosed inU.S. Pat. No. 4,782,832 hereby incorporated by reference in which thenasal pillow seals with the patient's nares and imposes the positiveairway pressure on the nasal passages.

The CPAP system meets with objections from patients, however, becausethe patient must exhale against the positive pressure. This increasesthe work to exhale. Some patients have difficulty getting used to thisand as result, may discontinue the therapy. Drying of the nose andairway due to continuous circulation of room air is also a complaint.Also, exhaled carbon dioxide tends to remain in some nasal masks withCPAP therapy.

In prescribing CPAP theraphy, it is usually necessary for a patient tospend one or two nightrs in a sleep treatment laboratory where it isfirst determined whether the patient has a respiratory disorder such assleep apnea. If so, the patient is then fitted with a CPAP devicewhereupon the required gas pressure is determined for providing thenecessary air splint to maintain airway patency.

The required pressure for maintaining patency is usually higher when thepatient is sleeping on his or her back than when sleeping in a side restposition. The higher pressure is usually prescribed in order to ensuresufficient pressure in all sleeping positions. The higher pressure isnot needed, however, in all circumstances. For example, before thepatient has fallen asleep and in the early stages of sleep, the higherpressures are not needed. Additionally, the higher pressures are oftennot needed during deep when the patient is in the side rest position.Furthermore, a given patient may only be subject to sleep apnea undercertain conditions such as when the patient is extremely tired or underthe influence of alcohol or sleep-inducing drugs. As a result, thepatient is subjected to the discomfort of the high prescriptionpressures even when not needed.

SUMMARY OF THE INVENTION

The inspiratory airway pressure system of the present invention solvesthe prior art problems as outlined above. More particularly, thepreferred systme hereof initiates inspiratory nasal air pressure justprior to inhalation in order to provide a pressure splint to offsetnegative inspiratory pressure and retain the normal position of thegenioglossus muscle thereby ensuring an open patient airway, andsubsequently reduces the pressure for ease exhalation. Airflow duringthis exhalation is primarily the patient's exhalent with desirablehumidity.

The preferred apparatus is adapted for connection with a patient-coupledgas delivery device for pressurizing at least a portion of a patient'srespiratory passages, such as the nasal pasages, with a breathable gas,preferably ambient air which may be supplemented with exygen, at acontrollable gas pressure. The apparatus includes means for determininga point in the patient's breathing cycle before the onset of aninhalation phase and subsequent to a prior inhalation phase, and furtherincludes gas control means for initiating, at the determined point inthe breathing cycle, an increase in the gas pressure toward a selected,and preferably prescribed, high pressure level. The gas control meansfurther cotrols the gas pressure at the higher level during at least aportion of the inhalation phase and subsequently lowers the gas pressurein order to present a lower pressure level during at least a portion ofthe subsequent exhalation phase.

In preferred forms, the apparatus trucks the patient's breathing cycle,thereby determines the end of the exhalation phase of the breathingcycle, and initiates the pressure increase at that point in thebreathing cycle. Alternatively, the apparatus determines an intervaltime as the point in the breathing cycle for increasing te inspiratorypressure as a function of previous breath rates and inhalation andexhalation intervals.

The apparatus desirably includes a controllable, variable speed blowerfor supplying ambient air above atmospheric pressure, a nasal pillow forcoupling with the patient's nares, a conduit intercoupling the blowerand nasal pillow, and a controllable, variably positionable vent valvecoupled with the conduit for venting air therefrom. The preferredapparatus also includes a controller operably coupled with the blowerand with the vent valve, and a pressure transducer for sensing thepatient's nasal air pressure.

In operation, the controller maintains a set point pressure by varyingthe position of the vent valve to vent greater or lesser amounts of airfrom the conduit in correspondence with patient exhalation andinhalation. The controller further tracks the position of the vent valveand thereby tracks the patient's breathing cycle. That is to say, as thepatient inhales during the inhalation cycle, the vent valve must closepartially to maintain the pressure of the ambient air as the patientinhales. In this way, the movement of the valve corresponds to theinhalation of the patient. Similarly, during exchalation at a preferredlower pressure set point, the vent valve must vent greater amounts ofambient air from the conduit which tracks the patient's exhalationphase. By such tracking, even at different set point pressures, thesystem hereof is able to increase the set point pressure predictablyprior to the onset of inhalation, and to subsequently decrease thepressure during the next exhalation phase.

In another aspect of the invention, sounds and pressure variationsassociated with a patient's respiratory passages are monitored and theset point pressure of the gas delivered to the patient's airways isvaried in accordance with monitored sounds. This aspect of the inventiontakes advantage of the fact that snoring sounds typically precede theonset of obstructive sleep apnea. That is to say, sleep apnea andsnoring sounds can be considered varying degrees of the same phinomenonin which the upper airway muscles may progressively relax resulting invibration of the partially relaxced air passage, and then may progressobstruction of the air passage when the upper airway muscles relaxcompletely. By monitoring airway sounds, and in particular snoringsounds, the applied pressure can be raised before an apneic event occursand thereby prevent the occurrence.

In another embodiment of the invention hereof, an apparatus and methodare disclosed for determining the airway patency of a patient and forquantifying that patency. By knowing the patient airway patency, theairway pressure applied to the patient can be optimized to aidrespiration and minimize discomfort associated with excessive pressure.That is to say, by determining patient airway patency, patientrespiration can be better characterized in some circumstances than bemonitoring airway sounds. Other preferred aspects of the presentinvention hereof are explained further hereinbelow.

BRIEF DESCRIPTION OF THE DRAWING FIGURES

FIG. 1 is a plan view of the head of a sleeping patient shown wearingthhe preferred patient-coupling head gear for use with the presentinvention.

FIG. 2 is a side elevational view of the patient's head and head gear ofFIG. 1 shown couple with the preferred housing cabinet of the dualconduit embodiment of the present invention;

FIG. 3 is a schematic representation of the single-conduit embodiment ofthe present invention;

FIG. 4 is a schematic representation of the dual-conduit embodiment ofFIG. 2;

FIG. 5 is an elevational view of the preferred vent valve element inposition over the vent ends of the udal-conduit embodiment of FIG. 4;

FIG. 6 presents graphical illustrations of a typical breathing cycleincluding an ingalation phase and an exhalation phase, of the nasal airpressure imposed on the patient's airway during the breathing cycle, andof the vent valve steps required to maintain the set point pressures;

FIG. 7 is an electrical schematic illustration of the microcontrollerand associated components of the present invention;

FIG. 8 is an electrical schematic of the blower motor control;

FIG. 9 is an electrical schematic of the stepper motor control for thevent valve;

FIG. 10 is a schematic illustration of a pressure transducer circuit;

FIG. 11 is a computer program flowchart illustrating the START-UPportion of the main routine;

FIG. 12 is a computer program flowchart of the MAIN LOOP portion of themain routine;

FIG. 13 is a computer program flowchart of the VALVE STEP subroutine;

FIG. 14 is a computer program flowchart of the ADC interrupt;

FIG. 15 is a computer program flowchart of the CHECK BLOWER SPEEDsubroutine;

FIG. 16 is an electrical block diagram illustating the spectral soundanalysis circuit;

FIG. 17 is a computer program flowchart of the SOUND ANALYSISsubroutine;

FIG. 18 is a schematic block diagram of another embodiment of theinvention for determining patient airway patency;

FIG. 19 is a set of five graphs of the embodiment of FIG. 18illustrating airway flow, pressure and admittance, and furtherillustrating two admittance templates;

FIG. 20 is a computer program flowchart for operating themicrocontroller of FIG. 18; and

FIG. 21 is a computer program flowchart of another program embodimentfor operating the microcontroller of FIG. 18.

FIG. 22 is a block diagram of the pneumatic components of thecompensation embodiment of the present invention;

FIG. 2 is a block diagram of the electronic components associated withthe compensation embodiment of FIG. 22;

FIG. 24 is a computer program flowchart of the PRIMARY module foroperating the compensation embodiment;

FIG. 25 is a computer program flowchart of the INITIALIZE module of thePRIMARY module;

FIG. 26 is a computer program flowchart of the EXHALE module of thePRIMARY module;

FIG. 27 is a computer program flowchart of the INHALE module of thePRIMARY module;

FIG. 28 is a computer program flowchart of the CPAP BACKUP module of thePRIMARY module;

FIG. 29 is a computer program flowchart of the BPM CYCLE BACKUP moduleof the PRIMARY module;

FIG. 30 is a computer program flowchart of the PATIENT CYCLE BACKUPmodule of the PRIMARY module;

FIG. 31A is a computer program flwochart of the first portion of the A/DINTERRUPT module of the PRIMARY module; and

FIG. 31B is a computer program flowchart of the remaining portion of theA/D INTERRUPT module.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

With reference to the drawing figures, FIG. 3 schematically illustratesthe single conduit embodiment of the preferred inspiratory airwaypressure apparatus 10 which broadly includes an elongated, flexible,hose or conduit 12, nasal pillow 14 connected to one end of conduit 12,vent valve assembly 16 positioned adjacent the opposed, open, vent endof conduit 12, blower unit 18 fluidically coupled with conduit 12between pillow 14 and vent valve assembly 16, and controller 20 which isadapted for pneumatic connection with nasal pillow 14 and electricalconnection with vent valve assembly 16 and blower unit 18.

In the preferred embodiment, vent valve assembly 16, blower unit 18, andcontroller 20 are housed within cabinet 22 such as that illustrated inFIG. 2 in connection with the dual-conduit embodiment. In this regard,conduit 12 presents an interior portion which is housed within cabinet22 and exterior portion 26 which extends from the cabinet to nasalpillow 14. Conduit 12 additionally presents coupling end 28 coupled tonasal pillow 14, inlet end 30 coupeld with blower unit 18 for reciving asupply of breathable gas, preferabllyu ambient air therefrom, and ventend 32 positioned adjacent vent valve assembly 16.

Nasal pillow 14 is the preferred patient-coupling device and is furtherillustrated in U.S. Pat. No. 4,782,832 which is hereby incorporated byreference. Head gear 34 holds nasal pillow 14 on the head of patient 36in order to fluidically couple with teh respiratory passages of patient36, and preferably with the patient's nares. Nasal pillow 14 isconfigured to present pressure sensor fitting 38 which is coupled withcontroller 20 by pneumatic line 40 which is preferably routed withinconduit 12 so that line 40 is conveniently out of the way and lesslikely to be pincherd or restricted by the patient during use ofapparatus 10. Nasal pillow 14 also includes vent port 42 definedtherethrough which continuously vent a small amount of pressure fromnasal pillow 14 in order to prevent moisture buildup and subsequentcondensation therein. Port 42 also prevents build up of exhaled gasesincluding carbon dioxide.

Vent valve assembly 16 includes stepper motor 44 and valve element 46connected to the output shaft thereof. Valve element 46 is preferablyconstructed of a flat plate configured to present two, opposed, arcuate,cam-like edges 48a, b as illustrated in FIG. 5. Element 46 is positionedadjacent vent end 32 of conduit 12 so that as stepper motor 44 rotatesvalve element 46 in a clockwise direction as viewed in FIG. 5, edge 48aprogressively covers and thereby restricts vent end 32. Conversely, asmotor 44 rotates element 46 in a counterclockwise direction, edge 48aprogressively exposes an increasing area of vent end 32 to ventadditionally gas therefrom.

FIG. 4 illustrates the dual-conduit second embodiment of preferredapparatus 10. This embodiment is similar to that of FIG. 3 andcorresponding components are numbered the same. Second embodiment 50additionally includes exhaust hose 52 presenting connection end 54fluidically coupled to conduit exterior portion 26 at junction 56, andpresents exhaust end 58 positioned adjacent valve element 46 in the sameopening/closing relationship with arcuate edge 48b as vent end 32presents to arcuate edge 48a. With this configuration, conduit 12additionally presents inhalation hose 60 between juncture 56 and blowerunit 18. In the dual hose model, nasal pillow 14 does not include venthole 42, and the tube between ends 54 and 28 include divider 61 toseparate it into two separate passages. Second embodiments 50 may alsoinclude inhalation check valve 62 disposed within inhalation hose 60adjacent juncture 56, and exhalation check valve 64 disposed withinexhaust hose 52 also adjacent juncture 56. Inhalation check valve 62prevents passage of patient exhalation therethrough toward vent and 32and thereby requires that the patient's exhalation exit the systemthrough exhaust end 58. Pneumatic lines 66 and 68 respectively couplecontroller 20 with inhalation hose 60 and exhaust hose 52.

By way of overview, controller 20 controls apparatus 10 in order toincrease the gas pressure presented to the patient at a time in thepatient's breathing cycle just prior to inhalation, and to subsequentlylower the pressure for ease of exhalation. The upper graph of FIG. 6illustrated a typical breath cycle air flow. During inhalation, the flowrate of gas to the patient gradually increases to a maximum and thendecreases. At the end of inhalation, the patient typically experiences aslight pause before exhalation begins. During exhalation, the exhaledgas flow from the patient gradually increases to a maximum and thendecreases again. A post-exhalation pause, typically somewhat longer thanthe post-inhalation pause, follows exhalation. After the post-exhalationpause, the patient again begins inhalation.

The middle graph of FIG. 6 illustrates the nasal airway pressurepresented to patient 36 during operation of apparatus 10. With patientssubject to sleep apnea, it is desirable to increase nasal airwaypressure just prior to inhalation to splint airway pressure in order toposition the genioglossus tissue and thereby maintain the airway open.Accordingly, this middle graph illustrates an increase in the nasalairway pressure just prior to inhalation to a selected prescriptionpressure level sufficient to push surrounding tissue aside and open thisairway. After completion of inhalation, the set point pressure presentedto the nasal airway is reduced so that exhalation occurs against a lowor even zero pressure level relative to ambient. At the end ofexhalation, the nasal airway pressure is again increased prior to thenext inhalation phase.

To accomplish these pressure variations, blower unit 18, in oneembodiment of the invention, produces a generally constant volume perunit time of breathable gas which is selectively vented through vent end32. The ented gas volume is controlled by vent valve assembly 16.

The bottom graph of FIG. 6 graphically depicts the various positions ofvalve element 46 in relation to vent end 32 in order to achieve thedesired nasal airway pressure profile illustrated in the middle graph.For example, during the post-exhalation pause, controller 20 activatesstepper motor 44 to rotate valve element 46 in a clockwise direction (asviewed in FIG. 5) in order to increase the nasal airway pressure to thedesired set point as senmsed by controller 20 by way of pneumatic line40. When the patient begins to inhale, gas output from blower unit 18 isinhaled by the patient. In order to maintain the set point pressure, thecontroller then rotates valve element 46 in stepwise fashion further inthe clockwise direction to reduce the amount of gas being vented. Asinhalation passes its peak flow rate, controller 20 begins to reversethe position of valve element 46 to vent additional gas for maintainingthe set point pressure.

At the end of inhalation, a lower pressure set point is desired andcontroller 20 continues, in stepwise fashion, to rotate valve element 46in the counterclockwise direction to vent additional amounts of gas forachieving a new lower set point pressure.

At the post-inhalation pause, the patient begins to exhale. In order tomaintain desired lower set point pressure, the additionally exhaustedgas from the patient must be vented through vent end 32. Accordingly,controller 20 causes valve element 46 to further rotate in a clockwisedirection to open vent end 32 even further. As the exhalation flow ratedecreases, controller 20 rotates valve element 46 in a clcokwisedirection to decrease venting in order to maintain the lower set pointpressure. At the end of exhalation, controller 20 then causes valveelement 46 to rotate further in the clockwise direction to increase thepressure to the higher pressure set point. This induces tension in thegenioglossus muscle to open the airway in preparation for the nextinhalation phase.

Inspection of the upper and lower graphs reveals a similarity in theprofile of the curves. That is to say, controller 20 is able to track apatients breathing cycle by tracking the stepped positions of valveelement 46 required to maintain the set point pressures. In this way,controller 20 is able to determine the end of respectiveinhalation/exhalation phases and to predict exhalation and inhalationinterval times.

Turning now to controller 20, it provides electrical outputs to controlthe speed of blower unit 18 and the position of stepper motor 44.Controller 20 receives electrical feedback from blower unit 18indicative of the speed thereof, and apneumatic input by way ofpneumatic line 40 to indicate the pressure at nasal pillow 14 andthereby in the patient's nasal airway passages.

Controller 20 includes pressure transducer circuit 700 (FIG. 7) forproviding an electrical input indicative of the pressure at nasal pillow14 to microcontroller circuit 800 (FIG. 8) which in turn providesoutputs to blower motor circuit 900 (FIG. 9) and stepper motor circuit1000 (FIG. 10), Additionally, controller 20 includes a convenitonal 120v.a.c. to +5 v.d.c., +12 v.d.c., and +24 v.d.c. power supply (not shown)suitable for digital and analog,solid state integrated circuitcomponents.

Pressure transducer circuit 700 illustrated in FIG. 7 is typical of thepressure transducer circuit for both the single and dual conduitembodimens of the present invention. That is to say, the single conduitembodiment of FIG. 3 uses only one pressure transducer whereas theembodiment schematically illustrated in FIG. 4 uses two pressuretransducers both using a circuit as illustrated in FIG. 7.

The preferred pressure transducer includes SENSYM type SX01DN having azero-to 70-cm. water operational range. The preferred transducerincludes four strain gages arranged in a conventional Wheatstone bridge701 having strain gages X1, X2, X3, and X4 presenting a nominal 4650ohms each. Bridge 701 presents excitation terminal 702 connected to +12v.d.c. and an opposed excitation terminal 704 connected to ground asshown. Bridge 701 produces outputs at terminals 706 and 708. Zeroadjustment potentiometer 710 internconnects terminals 704 and 706.

The output from terminal 708 is connected to the positive input terminalof operational amplifier 712 (one-half of Type LT1014). The output ofoperational amplifier 712 provides feedback to the negative inputterminal thereof, and, by way of resistor R1 (1K ohms) supplies thepositive input terminal of amplifier 714. The output is also connectedto ground by way of resistor R2 (750K ohms).

Strain gage bridge output terminal 706 is connected to the positiveinput terminal of operational amplifier 716 (the other half of unitLT1014). The output from amplifier 716 provides feedback to the negativeinput terminal thereof and is connected by way of resistor R3 (1K ohms)to the negative input terminal of amplifier 714.

The output from amplifier 714 provides feedback to the negative inputterminal thereof by way of resistor R4 (750K ohms). The output fromamplifier 714 is also connected by way of resistor R5 to output terminal718 which, by way of the circuitry just described, provides outputbetween 0 and +5 v.d.c. corresponding to a pressure of 0 to 25 cm.water.

A similar output is provided at a corresponding terminal 720 if a secondpressure transducer is used. In the dual-conduit embodiment, twotransducers provide additional pressure information which allows moreprecise tracking of inhalation and exhalation gas flows of the patient,and thereby more precise breath cycle tracking.

FIG. 8 is an electrical schematic diagram of microcontoller circuit 800which includes microcontroller 802 (Intel Type 8097BH), programmablearray logic (PAL) (Type PC16L8),erasable, programmable, read-only-memory(EPROM) (Type 27256), address latch 808 (Type 74HC373), random accessmemory (RAM) (Type 6264P), input/output serial data interface (RS232Type MAX232), prescription (RX) switch array 814, and input data latch816.

Microcontroller 802 receives power (Vcc) at +5 v.d.c. at terminals VCC,VPD, BW, RDY, VPP, and VREF as shown. Ground is connected to terminalsNMI, VSS, EA, and ANGND. Crystal 802 is coupled between terminals XTAL1and XTAL2 and shown and to which respective grounded capacitors C1 andC2 (33 pF each) are respectively coupled for timing signals at 12 MHZ.

Microcontroller 802 receives a reset signal at terminal RESET from restsub-circuit 802. On power up, power is supplied through resistor R5(100K ohms) to grounded capacitro C3 (22 uF) and to the input terminalsof SCHMITT trigger NAND gate 822. Initially , the resultant inputvoltage to NAND 822 is low, and its output is logic high. This logichigh output is supplied to output terminal 824 which provides a resetsignal to blower motor circuit 900 as discussed further hereinbelow. Theinitially logis high output from NAND 822 is inverted by invertor 826 toprovide a logic low signal to mocrocontroller terminal RESET which holdsmicrocontroller 802 in reset until th charge on capacitor C3 builds tothe trigger level of NAND 822. This provides time fot the system toinitialize and for transients to be suppressed. As the charge capacitorC3 increases to the trigger level, the reset signal is removed fromoutput terminal 824 and microcontroller 802. The output from invertor826 is also connected to one side of pull-up resistor R6 (10K ohms) theother side of which is connected to Vcc.

Reset circuit 820 also includes a normally open, reset switch 828coupled across capacitor C3 which allows manual reset. Diode D1 iscoupled access resistor R5 to provide a discharge path for C5 in theevent of power off.

Microcontroller 802 also receives a pressure transducer input atterminal ACH0 and also at ACH1 if a second transdcuer is used as in thedual-conduit embodiment. To provide transient suppression, and to smooththe analog voltage from pressure transducer circuit 700, one side ofcapacitor C4 (005 nF) is connected to terminal 718 along with the anodeof diode D2 and the cathode of diode D3. The other side of capacitor C4and the anode of diode D3 are connected to ground as shown and thecathode of diode D2 is connected to a supply voltage Vcc. An identicalcircuit is provided for terminal 720 using diodes D4, D5 and capacitorC5. Microcontroller 802 includes internal analog-to-digital converters(ADC) which receive the respective analog inputs at terminals ACH0 andACH1 and convert these to digital form for internal use inmicrocontroller 802.

Microcontroller 802 also receives an input at terminal HS1.0 which is apulse signal from blower motor circuit 900 representative of the speedof blower unit 18, discussed further hereinbelow.

Microcontroller 802 also uses a common address/data bus 830 whichinterconnects microcontroller 802 for data and address information flowwith PAL 804, EPROM 806, address latch 808, RAM 810, and data latch 816at the terminals as shown in FIG. 8. FIG. 8 also illustrates the otherconventional interconnections between these components as shown.

Microncontroller 802 provides a serial data output from terminal TXD toterminal 11 of interface 812 and receives data from terminal 12 thereofat microcontroller terminal RXD. Interface terminals 14 and 13 receiveRS232 data in an out which enable remote reading and control ofmicrocontroller 802 and thereby apparatus 10. This feature isparticularly useful ina sleep laboratory, for example, for adjusting theprescription pressures in order to achieve the optimal therapy.

Switch array 814 includes eight, selected switches for providing inputdata representative of the desired prescription set point pressures forinhalation and exhalation. In particular, the top fours switches areused to set the prescription inhalation pressure and the bottom fourswitches for prescription exhalation pressure. With four switches foreach set point, sixteen possible settings are available ranging between3 and 16 cm water for inhalation, and 0 and 14 cm water for exhalation.Data latch 816 is coupled with switch array 8014 as shown and latchesthe prescription data upon receipt of the latch signal from terminal 12of PAL 804. The prescription data is transmitted over bus 830.

Microcontroller 802 also provides two additional oututs. The first ofthese is data to stepper motor circuit 1000 by way of six-line outputbus 832 from microcontroller terminals P1.0-1.5 to output terminal 834.The second additonal output is a pulse-widt modulated sigynal (PWM) toblower motor circuit 900 by way of line 834 and output terminal 836.

FIG. 9 is an electrical schematic diagram respresenting blower motorcircuit 900 which receives the pulse width modulated signal at terminal836 from microcontroller 802, and also receives an inverted reset signalat terminal 824 from reset circuit 820. Blower motor circuit 900 alsoprovides a pulse output signal at terminal 902 representative of thespeed of blower motor 904 to microcontroller 802.

The reset signal received at terminal 824 is connected to terminal 10 ofmotor drive 906 (Type UC3524A). The pulse width modulated signal fromcontroller 802 at terminal 836 is provided to terminal 2 of driver 906by way of low pass filter C6 (1.0 uF) and resister R7 (24.9K ohms).

Driver terminal 7 is connected to ground by way of capacitor C7 (0.003uF), and terminal 6 is connected to ground by way of resistor R8 (49.9Kohms). Terminal 8 is connected to ground and terminal 15 receives powersupply at +12 v.d.c. Driver terminal 12, 13, and 16 are connected to Vccat +5 v.d.c.

Motor driver 906 converts the input pulse-width modulated signal at 0 -5v.d.c. to a corresponding outut at 0 to +12 v.d.c. at terminals 11 and14 thereof to programmable array logic (PAL) (Type 16L8) terminal 1.These terminals are also connected to ground by way of resistor R9 (0.5ohms). PAL 908 produces respective outputs at terminals 19 and 18 as twophases for the stator and rotor of brushless D.C. blower motor 904(Fasco Corp. Type 70000-S517). The PAL 908 outputs are respective inputsto level converters 910 and 912 (MC14504) which shift the voltage levelfrom +5 to +12 v.d.c. The +12 v.d.d. outputs from level converters 910and 912 are in turn tranwsmitted to the respective gates of field effecttransistors (SENSFET) (Motorola SENSFET type MTP40N06M) 914 and 916. Therespective drain terminal of SENSFETS 914 and 916 are respectivelyconnected to terminals 0A and 0B of blower motor 904 and provide therespective phase inputs to the stator and rotor thereof.

Power at +12 v.d.c. is additionally provided to level converters 910 and912 and to common power terminal CP of blower motor 904.

The source terminal of each SENSFET 914, 916 is connected to ground asshown.

SENSFETS 914,916 each include an additional pair of outputs on lines 918and 920 which provide a sampling of the current flow through therespective SENSFETS. These outputs are coupled across resistor R10 (100ohms) to provide a current path for the current sample, and theereby avoltage representative thereof to terminals 3 and 4 of motor driver 906.Driver 906 is responsive to this input voltage representative of thecurrent flow through blower motor 904 to reduce the duty cycle of theoutput at terminals 11 and 14 in the event of motor overcurrent.

Blower motor 904 is additionally equipped with Hall effect transducerwhich is operable to provide a voltage pulse each time a magnetic poleof the motor stator passes thereby. These output pulses represent thespeed of motor 904 and are provided at motor terminal HALL by way ofline 922 to output terminal 902, and as feedback to motor driver 906.The output pulses representative of motor blower speed at terminal 902are provided to microcontroller 802 at terminal HS1.0 thereof.

The pulses representative of motor blower speed are converted to arepresentative voltage before input to motor driver terminals 1 and 9.As shown in FIG. 9, line 922 is connected to one side of capacitor C8(0.01 uF) the other side of which is connected to one side of resistorR11 (10K ohms), and to the anode of diode D6. The other side of resistorR11 is connected to ground.

The cathode of diode D6 is connected to one side of grounded capacitorC9 (0.1 uF), to grounded resistor R12 (1M ohms) and to one side ofresistor R13 (100K ohms). The other side of resistor R13 is connected toone side of capacitor C10 (0.22 uF), to one side of resistor R14 (10Mohms), and to motor driver terminal 1 as input thereto. The other sideof capacitor C10 and resistor R14 are connected to driver terminal 9.

This network of components C8-C10, R11-R14 , and diode D6 convert thefrequency pulses on line 922 to a voltage representative thereof. Thatis to say, this network acts as a frequency-to-voltage converter owingto the large capacitance of capacitor C9 (0.1 uF) which provides a longtime constant. The voltage value provided at motor driver terminals 1and 9 provides feedback to an inernal comparator which compares thevoltage to set point derived from the pulse width modulated signalreceived at terminal 2.

FIG. 10 illustrates stepper motor circuit 1000 which activates steppermotor 44 to position valve element 46 in accordance with data receivedform microcontroller 802 at terminal 834 therefrom. Stepper motor 44 ispreferably a VEXTA model available from Oriental Motor Company and iscapable of providing one revolution in 400 "steps" and is also capableof half-stepping if needed. As those skilled in the art will appreciate,motor 44 is operable to shift one step upon the imposition of the nextsequential voltge step pattern provided as input at terminal 834 overoutput bus 832. In particular, bus 832 includes six lines, which arepattern data for the driver chip.

The step pattern data is provided to step motor driver chip 1002 (TypeS'GS' L298N) at terminals A, B, C, and D respectively from terminalsP1.0-1.3 of microcontroller 802. Driver 1002 shifts the input datavoltage from +5 v.d.c. to +12 v.d.c. for corresponding output atterminals 2, 3, 13, and 14 which are connected to stepper motor 44 toimpose the step pattern thereon at +12 v.d.c. The anodes of diodes D7,8, 9, and 10 are connected to the respective four output lines of driver1002, and the cathodes thereof are connected to +12 v.d.c. for voltagepull-up. Correspondingly, the cathodes of diodes D11, 12, 13, and 14 areconnected respectively to the output lines, and the respective diodecathodes connected to ground as shown for voltage pull-down.

As shown in FIG. 10, +5 v.d.c. is provided at driver terminal 9, +12v.d.c. at driver terminal 4, and terminals 1, 8, and 15 are allconnected to ground.

FIGS. 11-14 are computer program flowcharts illustrating the operativeprogram for microcontroller 802.

FIG. 11 illustrates the START-UP portion of the main routine of thecomputer program for operating microcontroller 802. After the logic lowreset signal goes logic high, the program enters at step 1102 whichprompts controller 20 to shift vent valve assembly 16 to its "home"position. In particular, this step prompts microcontroller 802 toproduce data of sequential pattern outputs by way of line 832 andterminal 834 to stepper motor control circuit 1000. This shifts steppermotor 44 to a mid-range position wherein valve element 46 blocks conduitends 32 and 58 about half-way as shown in FIG. 5, or conduit end 32alone in the single conduit embodiment. Step 1102 also initializes thevariables, counters, interrupt routines, and so forth in the program.

The program then moves to step 1104 to read the inhalation andexhalation prescription pressure values as set on switch array 814 andread by way of address data bus 830. These values are then stored inRAM. Step 1104 also prompts microcontroller 802 to set the operatingspeed of blower motor 904 in accordance with the prescription ofpressure set on switch 814. The blower speed should be set at a levelfast enough to ensure that sufficient ambient air volume is provided toconduit 12 such that the prescription pressure level can be attainedduring maximum inhalation. Blower motor speed data corresponding toprescription settings are stored preferably in a look-up table. Step1104 also clears any value stored in the internal buffer atmicrocontroller terminal HS1.0.

The program then moves to step 1106 which enables the program's timedinterrupts to begin timing.

In step 1108 the program sets the software flag "phase" equal toinhalation "I" which initializes the program from the inhalation phaseof the patient's breathing cycle. This step also initializes the blowercheck counter at zero. As discussed further hereinbelow, the programreads the blower speed after 128 passes through the main loop.

The program then moves to step 1110 which starts the internalanalog-to-digital converter (ADC) connected to microcontroller inputterminals ACHO and ACH1.

Step 1112 sets the pressure set point for the inhalation phase accordingto the inhalation prescription value set on switch array 814 accordingto data in a look-up table. This step also defines the start-up mode ofthe apparatus as continuous positive airway pressure (CPAP). That is tosay, and as explained further hereinbelow, the program operatesapparatus 10 in order to present a continous positive pressure at theinhalation set point pressure for the first eight breaths of a patient.Step 1112 also initializes the breath counter at zero in preparation forcounting patient breathing cycles.

After completion of step 1112 the program moves to MAIN LOOP 1200 of themain routine as illustrated in FIG. 12. Step 1202 is the first step ofthis routine in which the program calculates the average pressure assensed by pressure transducer 701 over eight ADC conversions. That is tosay, microcontroller 802 includes an internal "ring" buffer which storesthe eight most recent pressure readings received at microcontrollerterminal ACHO (and also ACH1 in the two-conduit embodiment). Asdiscussed further hereinbelow, ADC interrupt routine converts the inputanalog values to digital form every 22 microseconds and continuouslystores the most recent digital values in the ring buffer. Step 1020calculates the average value by dividing the cumulative buffer value byeight. Step 1202 also calculates the deviation, that is, error, in theaverage pressure from the pressure set point.

The program then moves to step 1204 which asks whether the magnitude ofthe error calculated in step 1202 is greater than allowed maximum error.This provides a so-called "dead band" to prevent the system from"hunting".

If the answer in step 1204 is yes, the program moves to step 1206 andcalculates the number of steps and direction of stepper motor 44required to correct the pressure deviation error. That is to say,depending upon the volume of air being produced by the blower, the fluidcapacity of the system, and the leakage therefrom, the number ofrequired steps can be determined approximately by reference to datapreviously stored in a look-up table.

The program then moves to step 1208 to executer routine "VALVE STEP"illustrated in FIG. 13 and discussed further hereinbelow. VALVE STEProutine 1300 sequentially presents the data patterns required to stepthe valve for the required number of steps in the direction determinedin step 1206.

After execution of sub-routine 1300 or after step 1204, the programreturns to step 1210. This step stores the number of valve steps anddirection actually implemented in an internal valve slope buffer whichcontinuously stores the previous eight movements of stepper motor 44.With this information, the slope of valve movement can be calculated bydividing the valve slope buffer sum by eight. This represents a slopebecause the eight values are stored at equal time intervals and thus thebuffer sum divided by eight represents the first derivative of valuemovement.

For example, and referring to FIG. 6, after the post-exhalation pause,and after achieving the desired set point pressure, no significant errorin pressure versus set point exists. Thus, no change in the valueposition is required and so the previous eight value steps would equalzero, indicating a slope of zero, which is indicated by the flat portionof the valve position curve in FIG. 6. In contrast, when the patientbegins to inhale, the valve position must initially and quickly shifttoward the closed position to maintain the pressure in conduit 32. Witha number of positive steps executed on stepper motor 44, the valuesstored in the slope buffer indicate a high positive slope. Conversely,near the end of inhalation, the valve must execute a number of steps inthe negative direction in order to maintain the pressure in conduit 32indicating a large negative slope. This slope information, as isdiscussed further hereinbelow, is used to determine various points inthe breathing cycle of a patient.

The program then moves to step 1212 which asks whether the phase flag isset for exhalation. The program was initialized with the phase flag setfor inhalation, and so, during the first few passes through main loop1200, the answer in 1212 is no and the program moves to step 1214 whichasks whether the phase flag is set for inhalation. Because this flag isinitialized as inhalation, the answer in step 1214 is yes and theprogram moves to step 1216.

Step 1216 asks whether the variable "timer counter" is greater than thevalue for variable "inhalation end time", and whether the slope ascalculated in step 1210 is less than or equal to -5. The variable "timercounter" (TMR CNT) is a software counter which was initialized at zeroand increments every 13 milliseconds. The variable "inhalation end time"was initialized at a default value representing inhalation timeequivalent to a predetermined average value. As discussed furtherhereinbelow, the variable "inhalation end time" is recalculated for eachbreath cycle after an initial eight passes through main loop 1200. Step1216 operates to determine whether sufficient time has passed for normalinhalation to be complete as additionally confirmed by the value slopebeing less than -5 as illustrated by the slope of the value positioncurve at the end of inhalation in FIG. 6.

During the first few passes through main loop 1200, the answer in step1216 is no and the program moves to step 1218 which asks whether theblower check counter, initialized at zero, is equal to 128. Until then,the answer in step 1218 is no and the program moves to step 1220 toincrement the blower check counter. The program then loops back to step1202 and repetitively executes steps 1202-1220 until the answer in step1218 is yes whereupon the program moves to step 1222 to execute thesub-routine "CHECK BLOWER SPEED" 1200 as illustrated in FIG. 15. Asdiscussed further hereinbelow, this step monitors the blower speed toensure that it is running at the set point speed initially set in step1104 in accordance with prescription settings. The program then returnsto step 1224 to reset the blower check counter at zero.

After sufficient time has elapsed to exceed the default time set for theinhalation end time, and when the slope of the valve position curve isequal to or less than -5 indicating the end of patient inhalation, theanswer in step 1216 is yes and the program moves to step 1218 which askswhether the mode of operation is set for inspiratory nasal air pressure(NAP). This was initialized in the CPAP mode in step 1112. During thefirst eight breathing cycle, the answer in step 1226 is no, and theprogram moves to step 1228 which asks whether the breath counter is lessthan or equal to eight. The breath counter was initialized at zero andduring the first pass of the program the answer in step 1220 is yes, andthe program moves to step 1230 to increment the breath counter.

The program then moves to step 1232 which sets the variable "cycle time"equal to the current value existing on the timer counter. This step isentered at the end of each inhalation phase and marks the end of onebreath cycle and the beginning of another. Thus, the time of one breathcycle, that is, cycle time, equals the time value existing on the timercounter which is reset to zero at the end of each breath cycle, also instep 1232.

Step 1232 also sets a new inhalation interval time equal to the newcycle time divided by three. Statistically, inhalation time averagesabout 40% of a typical breathing cycle. Step 1232, however, sets theinhalation interval equal to 33% of the most recent cycle time in orderto ensure that this value clocks out in step 1216 early, that is, beforethe end of anticipated actual inhalation time.

Step 1232 also sets the variable "inhalation start time" equal to thenew cycle time divided by two. With the beginning of a cycle marked asthe end of an inhalation phase, the next inhalation start time wouldnormally be expected to occur after 60% of the cycle time has elapsed.Step 1232, however, sets inhalation start time at 50%, that is earlierthan the predicted inhalation time in order to ensure an increase innasal pressure before inhalation would be expected to begin.

After main loop 1200 has detected eight breath cycles as indicated onthe breath counter, the answer in step 1228 is no and the program movesto step 1234 which sets the operating mode as INAP. The eight cycledelay in setting the INAP mode ensures reliable data in tracking thebreath cycle.

With the mode now set as INAP, the answer during the next pass at step1226 is yes and the program moves to step 1236 to set the pressure setpoint equal to the exhaust prescription. That is to say, an inhalationphase has ended as determined in step 1216, eight breaths have beentracked as determined in stepp 1228, the mode is set as INAP whichallows a decrease in pressure during exhalation. With these conditionssatisfied, the controlled pressure set point is lowered to theprescribed exhaust prescription set point.

Normally, the exhaust pressure would be prescribed at zero, that isambient, so that the patient can exhale normally. In some circumstances,however, the therapist may desire a slight positive pressure duringexhalation which is set on the lower four switches of switch array 814(FIG. 8).

Step 1236 also sets the phase flag for exhalation.

During the next pass through main loop 1200, the answer in step 1212 isnow yes, that is, the phase is "exhalation", and the program moves tostep 1238 which asks whether the current value on the timer counter isgreater than or equal to the inhalation start time as previously set instep 1232. In the alternative, step 1238 asks whether the valve positionslope is greater than seven which independently indicates the end ofexhalation. With reference to FIG. 6, at the end of exhalation, thevalve must step in the positive direction rapidly in order to restrictvent end 32 for maintaining the set point pressure. This rapid changeindicates a positive slope greater than 70.

If the answer in step 1238 is no, the program continues to loop throughuntil the answer is yes at which time the program moves to step 1240 toset the phase flag for inhalation, to set the pressure set point at theinhalation prescription value, and to set the value for the variable"inhalation end time" equal to the currently existing timer count plusthe inhalation interval time. The existing value of the timer countercorresponds to the time elapsed since the beginning of the currentbreath cycle, which marked the end of the previous inhalation phase. Theinhalation phase about to begin should end on or after the current timercount value plus the inhalation interval time. Thus, step 1240 providesa new value for inhalation interval time for use in step 1216. Normally,this value is reached before the end of the actual inhalation and isused to ensure that a transient slope reading does not erroneously markthe end of the inhalation phase. Thus the requirement in step 1216 forboth the expiration of the inhalation end time and a slope less than orequal to -5.

As those skilled in the art will appreciate, step 1238, in cooperationwith the balance of the operating program, ensures that the inhalationset point pressure increases before the onset of patient inhalation.First, by monitoring whether the valve position slope exceeds seven, theend of exhalation can be detected. Marking the end of an exhalationphase ensures that this is a point in the breath cycle prior to thebeginning of the next inhalation phase. Additionally, an increase in thepressure prior to inhalation is assured by monitoring whether the timercounter is greater than or equal to the predicted inhalation start timein step 1238. Thus, if a sporadic or erroneous slope reading weredetermined, an increase in nasal pressure would still be ensured priorto inhalation when the timer counter excess the predicted inhalationstart time, recalling that the inhalation start time was set in step1232 somewhat shorter than the expected start time.

FIG. 13 illustrates VALVE STEP sub-routine 1300 which operates to imposesequentially the required step patterns on stepper motor 44 by way ofstepper motor circuit 1000. Sub-routine 1300 enters at step 1302 bysetting the variable "final valve postion" equal to the current valveposition plus (or minus) the valve correction required as determined instep 1206 (FIG. 2). Step 1302 also sets the variable "valve position"equal to the current valve position.

The program then moves to step 1304 which asks whether the correctiondirection is greater than zero, that is, in a positive direction torestrict vent end 32, or in the opposite direction. If the answer instep 1304 is yes, the program moves to step 1306 which asks whether thefinal position as determined in step 1302 exceeds step 160. That is tosay, this step determines whether the requested or desired final valveposition is beyond the maximum allowed position. If yes, the programmoves to step 1308 which sets the final valve position equal to 160.

If the answer in step 1306 is no, or after step 1308, the program movesto step 1310 to set the variable "valve position" equal to "valveposition" plus one. In other words, the program increments stepper motor44 one step at a time until the final position is achieved.

The program then moves to step 1312 which asks whether the new valveposition is less than or equal to the final valve position as determinedin step 1302. If no, which indicates that the desired final valveposition has been achieved, the program returns to main loop step 1210.

If the answer in step 1312 is yes, indicating that the final valveposition has not yet been achieved the program moves to step 1314 whichretrieves the step pattern for the next blower motor step from memory.The program then activates the lines of bus 832 in order to send thisstep pattern to stepper motor circuit 1000 and thereby to stepper motor34.

The program then loops back to step 1310 to continue executing steppatterns one at a time in sequence until the final position is obtained.

If the rotational direction for correction requires is negative asdetermined in step 1304, the program moves to steps 1316-1324 asillustrated to execute the required number of stepping patterns to shiftthe valve in the "negative" direction to reduce pressure by venting moreair. Step 1316 asks whether the final position determined in step 1302is less than zero indicating a valve position beyond the allowablelimits of travel. If yes, the program sets the final position equal tozero in step 1318.

Step 1320 then decrements the "valve position" variable and step 1322asks whether the newly determined "valve position" is greater than orequal to the final position desired. If yes, the step moves to program1324 and then loops back to step 1322. If the answer is step 1322 is no,the program returns to main loop step 1210.

FIG. 14 illustrates ADC interrupt sub-routine 1400 which has itsinterrupt executed every 14 micro-seconds for providing ananalog-to-digital conversion for the pressure data received frompressure transducer circuit 700, and to store this data in memory.Subroutine 1400 enters at step 1402 which retrieves the current datafrom the ADC register internal to microcontroller 802. This data is thenstored in the ADC buffer for use in step 1202 (FIG. 12) of the mainloop. This data is stored at location "L" which is one of the eightbuffer locations. The program then moves to step 1404 to incrementlocation variable "L" so that the next set of ADC data is placed int henext buffer location. The program then moves to step 1406 which askswhether "L" is equal to eight which is greater than the number oflocations provided in the ADC buffer. If yes, the program resets "L" atlocation which is the first location in the buffer. After step 1408, orif the answer in step 1406 is no, the program moves to step 1410 whichinstructs the ADC to begin another data conversion. The program thenreturns from the interrupt to the main loop.

FIG. 15 illustrates CHECK BLOWER SPEED subroutine 1500 which is enteredfrom step 1222 of main loop 1200, and enters at step 1502 which readsthe current blower speed as received at microcontroller terminal HS1.0from the Hall effect transducer in blower motor 94. The program thenmoves to step 1504 which retrieves the blower speed set pointcorresponding to the prescription inhalation pressure and compares theset point to the sensed lower speed. The program then moves to step 1506which asks whether the blower speed is within a maximum error range ofthe set point speed. If no, the program adjusts, in step 1508, thepulse-width of the pulse width modulated signal produced atmicrocontroller terminal PWM and transmitted to blower motor circuit900. After step 1508, or if the answer in step 1506 is yes, the programreturns to the main loop.

AIRWAY SOUNDS EMBODIMENT

FIGS. 16 and 17 illustrate another aspect of the invention in whichpatient airway pressure variations and, in particular, airway sounds aremonitored and the patient airway pressure controlled in response. Inparticular, FIG. 16 is an electrical block diagram illustrating soundanalysis circuit 1600 which receives input from pressure sensor circuit700 by way of terminal 718 thereof, and which delivers outputs tomicrocontroller 802. As those skilled in the art will appreciate, soundsare pressure variations and as such, preferred pressure sensor circuit700 is also operable for sensing pressure variations representative ofairway sounds and in converting these variations into representativesignals at terminal 718.

The signals from pressure sensor circuit 700 are delivered topreamplifier 1602 which boosts the signal level for delivery to low-passfilter 1604, band-pass filter 1606, band-pass filter 1608, and high passfilter 1610. Low-pass filter 1604 is included to provide output "DC" tomicrocontroller 802 indicative of low frequency (subaudio) pressurevariations and nasal pressure.

Filters 1606-10 split the audio frequency spectrum into threecomponents: 10-200 Hz., 200-800 Hz., and 800+Hz., respectively. Theoutputs from filters 1606-10 pass through respective rectifiers 1612,1614, and 1616 which in turn provide rectified outputs to low-passfilters 1618, 1620, and 1622. Low-pass filters 1618-22 convert therespective rectified inputs to equivalent D.C. voltage outputs "LOW","MED", and "HI" which represent the respective audio spectralcomponents. These three outputs along with output "DC" are provided asinputs to microcontroller 802 which uses internal analog-to-digitalconversion to produce digital data representative of the three spectrumcomponents.

FIG. 17 is a computer program flowchart of SOUND ANALYSIS subroutine1700 which is advantageously included as part of the program foroperating the microcontroller 802 in connection with the pressurevariation aspect of the invention. Subroutine 1700 enters at step 1702which initiates analog-to-digital conversion of the analog inputs "DC","LOW", "MED", "HI" received from circuit 1600. In the preferredembodiment, step 1702 is implemented a number of times (for example, tentimes) for each inhalation and the conversion values averaged. Theaverage values of the digital representations of DC, LOW, MED and HI arethen used for steps 1706-1716 as discussed further hereinbelow.

The program then moves to step 1704 which sets the software variable"old state" (OS) equal to the variable "new state" (NS) determined inthe previous passes through the program. This step then sets variable NSequal to zero.

In step 1706 the program asks whether input "DC" is greater than apredetermined threshold value. This threshold value is set at a levelsufficient to indicate that detectable airway sounds are occurring. Ifthe answer is no, the program returns to the main loop. If yes, theprogram moves to 1708 in which, along with subsequent steps, conducts aspectral analysis of the airway sounds as determined by circuit 1600. Inparticular, step 1708 asks whether input LOW is of a predeterminedthreshold. If yes, the program moves to step 1710 which incrementsvariable NS by 1.

If the answer in 1710 is no, or after step 1710, the program moves tostep 1712 which asks whether input MED is above its associatedthreshold. If yes, the program moves to step 1714 which incrementsvariable NS by 2.

If the answer in step 1712 is no, or after step 1714, the program movesto step 1716 which asks whether input HI is greater than itspredetermined threshold. If yes, then step 1716 increments variable NSby 4.

If the answer in step 1716 is no, or after step 1718, the program movesto step 1720. Step 1720 calculates the variable "transition" (T) as afunction of variables OS and NS as shown in FIG. 17. Variable T providesa spectral quantification of the airway sounds for use in determiningwhich action, if any, should be taken concerning the increase ordecrease of the gas pressure applied to the respiratory passages of thepatient. This determination occurs in step 1722 by use of a so-called"action table" which is a look-up table stored in memory using variableT as a pointer. The preferred action table is incorporated as part ofthe disclosure hereof as Appendix l attached hereto.

Upon determining the proper action including increase, decrease, ormaintain pressure from the action table, the program moves to step 1724which executes that action. In the preferred embodiment,actiondesignated changes in pressure are in increments of 1.0 cm. waterpressure.

If the action determined in step 1722 is "none", which indicates thatsnoring sounds are not occurring, it is preferred in step 1724 that thepatient-applied the pressure be decreased by 0.5 cm. water. In this way,the program assures that the pressure is not maintained at a levelgreater than that necessary. For example, if the detected airway soundsprompts an increase in pressure, and the airway sounds then disappear,it may be that the pressure was increased slightly more than necessary.Accordingly, the program will automatically decrease the pressure overtime in small increments until airway sounds are again detected.

The aspect of the present invention described above in connection withFIGS. 16 and 17 monitors airway sounds in the preferred embodiment. Itwill be appreciated, however, that pressure transducer circuit 700 issensitive to many types of pressure variations other than thoseassociated with airway sounds. For exampe, circuit 700 could be used todetect inaudible vibrations or pressure variations associated withexhalation and inhalation. With this capability, much information can begarnered about a patient's respiration such as whether the patient'srespiration rhythmic, erratic, or apneic as well as breath rate,inhalation and exhalation durations, and flow rates. Hence, with thiscapability the patient's respiration can be properly characterized andaspects of the respiration quantified.

Furthermore, this information can be stored in stored in memory forsubsequent downloading for use by a physician, for example, indiagnosing respiratory afflictions and efficacy of treatment. In thisway the expense and time consumed in sleep lab facilities is avoided orat least minimized. Additionally, patient comfort is enhanced becauseonly the minimum required pressure is imposed both during sleep andbefore the patient falls to sleep. With increased comfort, the patientis more likely to use the prescribed treatment on a sustained basis andthereby gain the maximum benefit therefrom.

As those skilled in the art will appreciate, the present inventionencompasses many variations in the preferred embodiments describedherein. For example while the present invention is useful in treatingsleep apnea, its utility is not so limited, but rather, the presentinvention is useful in treating many conditions in which facilitatedrespiration is a factor in treatment. For example, increased respiratoryair pressure beginning just prior to inhalation induces a deeperinhalation than might otherwise occur. This may be useful in treatingcertain cardiovascular conditions where deeper inhalation and therebygreater oxygenation of the blood is beneficial when accompanied bydecreased pressure to ease exhalation. Additionally, the presentinvention encompasses the use of any breathable gas such as anesthesiaor oxgen-supplemented ambient air.

As discussed above, the nasal pillow is the preferred means for patientcoupling in order to impose higher breathable gas pressure on therespiratory passages of the patient. The present invention, however,also encompasses a nasal mask, or a full face mask which may be desiredin certain situations such as the application of anesthesia asbreathable gas as discussed above.

In the preferred embodiment of the present invention, the position ofthe vent valve assembly is varied in order to increase or decrease thepressure of the breathable gas applied to the patient's respiratorypassages. As the detailed description reveals, however, the apparatushereof includes the capability of varying the speed of the blower unitwhich could be used instead to selectively vary the applied pressure.This would eliminate the need for the vent valve and stepper motor andreduce the manufacturing cost which would be advantageous as anotherembodiment of the invention.

The present invention also encompasses the variation wherein thebreathable gas is compressed and stored in a storage bottle, forexample.

As described above, the preferred controller includes microcontroller802 which is operated by a computer program. Other equivalent controlmeans might include a custom designed chip with all functionsimplemented in hardware without a computer program.

As disclosed in FIG. 6 herein and the accompanying narrativedescription, it is preferred to track the patient's breathing cycle bytracking the movement of vent valve assembly 16. Those skilled in theart will appreciate that the breath cycle can be tracked by other meanssuch as monitoring chest contractions and expansion, breathing sounds,directly sensing genioglossus muscle activity, or some equivalentparameter indicative of a breathing cycle.

As a final example, some therapists may prefer that the apparatus startup in a low pressure or zero pressure mode while the breath cycle isinitially tracked. This may provide further patient comfort in the useof the invention.

ADMITTANCE EMBODIMENT

FIGS. 18-21 illustrate another embodiment of the present invention inwhich patient airway patency is determined and preferably used as thebasis for controlling airway pressure applied to the patient. Turninginitially to FIG. 18, apparatus 1800 includes flow sensor 1802 (HansRudolph Pneumotach available from the Hans Rudolph Company of KansasCity, Missouri), differential pressure (DP) sensor 1804 (SENSYM typeSX01DN), pressure sensor 1806 (SENSYM type SX01DN), operationalamplifiers 1808 and 1810, analog signal divider 1812 (Analog Devicesmodel AD539) operably coupled with microcontroller 802.

In operation, flow sensor 1802 is preferably coupled in exterior portion26 of conduit 12 so that breathable gas supplied to the patient passestherethrough. Sensor 1802 provides a pair of pneumatic output signalsrepresentative of the gas flow to DP sensor 1804 which in turn providesa pair of output electrical analog signals from the internal bridgerepresentative of the flow to amplifier 1810.

Pressure sensor 1806 is pneumatically coupled with exterior portion 26preferably downstream from flow sensor 1802. Pressure sensor 1806provides a pair of signals from the internal bridge to amplifier 1808representative of the gas pressure being supplied to the patient.

Amplifiers 1808 and 1810 provide respective analog output signalsrepresentative of the instantaneous gas pressure and flow being suppliedto the patient by way of lines 1814 and 1816 to divider 1812. Divider1812 performs an analog division of the flow and pressure signalspresented on lines 1814, 1816 and thereby produces an analog outputsignal on line 1818 representative of the instantaneous admittance (A)of the patient's airway. That is to say, admittance is the inverse ofimpedance, but patient flow can be zero which prevents directcalculation of impedance as pressure divided by flow. However, bydividing flow by pressure, and thereby determining admittance, suchproblems are avoided.

As explained further hereinbelow in connection with the computer programflowchart in FIG. 21, it may be desirable to eliminate divider 1812 incertain applications and perform the division functions withinmicrocontroller 802. If such is the case, line 1818 along with divider1812 are eliminated, and the pressure and flow signals on lines 1814,1816 are provided directly to microcontroller 802.

FIG. 19 includes graphs 1902, 1904, 1906, 1908. and 1910 which aid inillustrating how patient airway patency is determined in the presentinvention. These graphs respectively plot flow F, pressure P, admittanceA, template T1, and template T2 versus seven discrete timescorresponding to those times when microcontroller 802 performsanalog-to-digital conversions of the input information. The plot ofadmittance in graph 1906 is a function of the flow and pressure dataillustrated in graphs 1902, 1904 respectively.

In the operation of microcontroller 802 in accordance with the programsof FIGS. 20 and 21 the admittance plot for the inhalation portion of asingle breath cycle is compared to admittance templates stored in memoryto determine which template provides the "best fit" with the latestadmittance plot. The best fit is determined by using conventionalroot-mean-square techniques. The template which fits best is used as a"pointer" for a look-up table to select action to be taken such asraising or lowering gas pressure delivered to the patient.

FIG. 20 illustrates a computer program flowchart of subroutine 2000 foroperating microcontroller 802 of the embodiment shown in FIG. 18 usingdivider 1812. Routine 2000 enters at step 2002 which activatesmicrocontroller 802 to digitize the admittance signal received on line1818 at the predetermined times during patient inhalation and to storethe converted admittance data in data array "A."

After all of the signals for inhalation signals have been digitized,step 2004 then normalizes the amplitudes of the amplitude data in array"A." That is to say, the peak-to-peak amplitude value of the array datais normalized to a predetermined constant. This is done because, in thepreferred embodiment, the shape of the admittance data is of interest,not the absolute values.

Similarly, step 2006 normalizes the time base of the admittance dataarray "A" so that the time base matches that of the templates. This isneeded because inhalation times vary from breathe to breathe.

The program then moves to step 2008 which computes a root-mean-square(RMS) value for the difference between the corresponding data points inarray "A" and each template stored in memory according to the formulashown.

The program then moves to step 2010 which determines which templatepresents the lowest RMS value, this being the template that "best fits"the admittance data for that inhalation of the patient. Step 2012 thenuses the template selected in step 2010 as a software "pointer" toselect an appropriate action, such as increase, decrease or maintainpressure, from a look-up table such as that illustrated below:

    ______________________________________                                                T1          Maintain                                                          T2          Increase                                                          T3          Increase                                                          *           *                                                                 *           *                                                                 *           *                                                                 TN          Decrease                                                  ______________________________________                                    

FIG. 21 is a computer program flowchart of module 2100 for operatingmicrocontroller 802 in the embodiment of FIG. 18 when divider 1812 andline 1818 are not used, and when lines 1814, 1816 are connected directlyto microcontroller 802 for providing the pressure and flow signals. Thisvariation is advantageous when greater presicion is desired because ofthe non-linear characteristics of patient airways.

Module 2100 enters at step 2102 which digitizes the flow signalsreceived by microcontroller 802 by way of line 1816 at the predeterminedinterval times. The digitized flow data is then stored in array "F".Step 2104 then normalizes the time base of the data in array "F."

The program then moves to step 2106 which uses Fast Fourier Transform(FFT) to convert the amplitude vs time data in array "F" to amplitude vsfrequency data.

Simultaneous with steps 2102-2106, module 2100 executes analogous steps2108, 2110 and 2112 for the pressure information received bymicrocontroller 802 over line 1814.

After the flow and pressure data have been converted, the program movesto step 2114 which computes admittance "A" for each corresponding flowand pressure data points. In some circumstances, depending upon theparticular application and the level of accuracy desired, it may beadvantageous to amplitude normalize the pressure and flow array data orthe admittance data.

Module 2100 then executes 2116, 2118 and 2120 which are the same assteps 2008-2012 discussed above in connection with module 2000 and theaction table.

It will be appreciated that after determination of the best-fittemplate, patient airway patency is effectively quantified. That is tosay, the set of templates stored in memory could represent a range ofpatencies (in percentages, for example) and the best-fit templaterepresents a corresponding patency as a percentage. Additionally, thepatency templates are preferably a set custom-developed for theparticular patient being treated. Furthermore, it may be advantageous tocontinuously update the set of templates by storing successiveadmittance array data in memory as a new template. Additionally, certaintemplates could be designated as templates characteristic of wakefulnessor sleep states. Finally, in some circumstances the highest level ofaccuracy is not required, a summation of the admittance data of a giveninhalation, or an average thereof over a number of inhalations, could beused itself as a quantification of airway patency.

Those skilled in the art will appreciate that the present inventionecompasses many variations in the preferred embodiments describedherein. For example, ultrasound techniques could be used to establishairway patency. Additionally, when the gas pressure applied to thepatient is relatively constant, only flow variations are of interest andare the only variable parameter which may be considered. As a furtherexample, a sensitive thermocouple or thermistor could be used as anindication of gas flow.

STIMULATION EMBODIMENT

As described above in connection with FIGS. 16 and 17, the spectralsounds embodiment of the present invention analyze the patient airwaysounds to determine an appropriate response for preventing an apneicepisode. In the spectral sounds embodiment, the appropriate actionincreases, decreases or maintains the airway pressure applied to thepatient. In the stimulation embodiment, the preferred response is theapplication of electrical stimulus externally applied to the neck of thepatient in the vicinity of the upper airway muscles, although implantedelectrodes would be used equivalently to stimulate the muscles or themuscle nerves.

The preferred apparatus includes a flexible, elastic neck collar, amicrophone carried by the collar, a pair of electrodes also carried bythe collar, and control circuitry interconnecting the microphone and theelectrodes. The electrodes and microphone could also be affixed byadhesive or other equivalents means instead of the preferred collar. Thepreferred control circuitry includes the components and programdescribed above in connection with the airway sounds embodiment. Theprimary difference being that instead of increasing air pressure, theaction is to activate the stimulating electrodes at the beginning ofeach inhalation phase of the patient breath cycle.

To use the stimulation embodiment, the patient couples the collar aboutthe neck with the electrodes positioned in front about either side ofthe neck centerline and just underneath the jaw in order to stimulatethe upper airway muscles when activated. In operation, the microphonedetects airway sounds and the control circuitry analyzes these sounds asdescribed above in connection with FIGS. 16 and 17. Whenever an actionis determined corresponding to "increase" pressure (FIG. 17, Step 1724),this is interpreted as imminence of an apneic event. That is to say,gradual closing of the airway due to relaxation of the upper airwaymuscles produces sound patterns indicative thereof which also indicates,that is, predicts that an apneic episode may occur on a subsequentbreath. Thus, when it is determined that an increase airway patency isneeded, the control circuitry activates the electrodes to stimulate theupper airway muscles. Additionally, it is preferred to vary the strengthof the electrical stimulation according to the breath sounds in the samemanner that airway pressure is varied in connection with the admittanceembodiment discussed above in connection with Appendix I. In the eventthat inhalation is not detected for a predetermined time based upon afixed time or based upon previous breathing patterns the preferredbreathing device activates the electrodes to stimulate the upper airwaymuscles.

In this way, apneic episodes are prevented while at the same timeelectrode stimulation is not imposed when not needed. This is inconstrast to the prior art in which stimulation is not provided until anapneic episode has already occurred. This is also in contrast to thoseprior art devices which stimulate on each inhalation effort such as thatset forth in U.S. Pat. No. 4,830,008, hereby incorporated by reference.As those skilled in the art can appreciate, if stimulation is appliedwith every inhalation, the patient effectively gets used to thestimulation and it is no longer as effective. The present invention, onthe other hand, prevents stimulation when conditions are absentindicating, that is, predicting an apneic episode, but yet ensuresstimulation before an apneic episode. Thus, the two main disadvantagesof the prior art stimulation techniques are avoided.

As those skilled in the art can appreciate, other means can be used todetect the imminence of an apneic episode. For example, by monitoringairway admittance as discussed above in connection with FIGS. 19-21, anapneic episode can be predicted and stimulation applied when this occus.That is to say, by monitoring admittance during inhalation, a narrowingof the airway can be detected by monitoring the admittance, and whenadmittance decreases to a predetermined level, stimulation can beapplied. Furthermore, the imminence of an apneic episode could bedetermined by using airflow sensors such as thermistors or thermocouplesat the nose or mouth, or a static-charge sensitive "bed", or bands forsensing chest or abdomen movement preferably a RESPITRACE brand sensor.

COMPENSATION EMBODIMENT

The preferred embodiment disclosed in FIGS. 1-4 uses pressure sensor 38mounted adjacent the patient nasal fitting. In some circumstances,however, this may not be practical. Instead, for compactness and economyof manufacture, it may be desirable to use pressure and flow sensorscoupled with the patient pneumatic line at the point where this lineleaves cabinet 22. This arrangement, however, may allow inaccuracies inmeasurement to occur because of downstream pneumatic leaks and pressuredrops in the line which vary nonlinearlly with flow to the patient. Inaddition to unintended leaks, it is preferable to have a vent at thepatient's nasal connection to prevent buildup of carbon dioxide. Thus,flow and pressure as measured at the cabinet outlet may not provideaccurate data concerning the actual pressure delivered at the patient'snose. The compensation embodiment of the present invention measurespressure and flow at the cabinet outlet but still provides accuratemeasurement of the presented to the patient by compensating for leaksand pressure drops.

FIG. 22 is a schematic block diagram illustrating the pneumatic system70 which includes some components in common with those previouslydescribed and are numbered the same. System 70 additionally includesinlet air filter 71, exhalation solenoid 72 with exhalation valve 73connected thereto, bacteria filter 74, flow element 75 with flow sensor76 connected in parallel thereto.

FIG. 23 is an electrical block diagram illustrating the preferredcomponents of controller 20 for controlling and operating pneumaticsystem 70 of this embodiment. Controller 20 includes power supply 80,microprocessor 81, microprocessor memory 82, analog to digital (A/D)conversion circuitry 83, interface circuitry 84, serial communicationport 85 with remote control 86 connected thereto, keyboard and displaycontrol 87 with keyboard display panel 88 connected thereto.

FIGS. 24-31B are computer program flowcharts illustrating the operationof the program stored in memory 82 for operating microprocessor 81 andthereby for opening controller 20 and pneumatic system 70. FIG. 24illustrates PRIMARY module 2400 which shows to overall arrangement andoperation of the preferred program. PRIMARY module 2400 enters at step2402 at power up when power supply 80 is activated. The program thenexecutes INITIALIZE module 2500 (FIG. 25).

Step 2402 then asks whether the control mode is set to exhale or inhale.If set to inhale, step 2402 then asks whether the control mode has beenset. In no, the program executes INHALE module 2700 (FIG. 27).

If the control mode has been set to exhale in step 2402, step 2406 thenasks whether the control mode has been set. If no, the program executesEXHALE module 2600 (FIG. 26).

If the answers in steps 2404 or 2406 are yes, or upon return from EXHALEand INHALE module 2500 and 2600, the program moves to step 2408 whichasks which backup mode has been selected. The program then excutes theselected backup module illustrated in FIGS. 28-31B, after which theprogram loops back to step 2402. As FIG. 24 indicates, afterinitialization, the program operates alternatively through the exhaleand inhale branches to set the respective exhale and inhale pressuresand then proceeds to the selected backup module to determine whetherbackup operation is needed.

FIG. 25 illustrates INITIALIZE module 2500 which enters at step 2502 toset the variables indicated to their initial values as shown. Step 2504when sets the pressure control mode to inhale and step 2506 clears thecontrol mode flag indicating that the control mode has not been set.

Steps 2508 and 2510 then set the flow bias (Fbias) variables for inhaleand exhale for the amounts corresponding to the vent or bleed holepresent in the preferred nasal pillow shell used for connection with thepatient airways. Step 2512 then reads the prescribed pressure settingsset on switch 814 (FIG. 8).

Next, step 2514 sets a softwave flag indicating that the next analog todigital interrupt will read pressure transducer data (when not set, theA/D interrupt reads flow transducer data). An A/D conversion forpressure is then immediately executed in step 2516.

Blower 18 is then started at a speed sufficient to produce theprecription pressure setting. The program then results to step 2402(FIG. 24).

FIG. 26 illustrates EXHALE module 2600 which is entered when the exhalebranch of PRIMARY module 2400 detects that the exhale flag has been set.Module 2600 enters at step 2602 which sets the patient pressure at theexhale prescription pressure. Step 2604 then opens exhalation valve 73by activating exhalation solenoid 72.

The phase control flags are then reset in step 2606 and the blankinginterval counter cleared in step 2608. The program then returns to thePRIMARY module.

FIG. 27 illustrates INHALE module 2700 which is entered at the beginningof inhalation and which is repeatedly executed during patientinhalation. Module 2700 enters at step 2702 which sets the total breathcount to the sum of the inhale sample counts. As discussed furtherhereinbelow, each inhalation and exhalation is counted and this steptakes the sum of these counts to determine a value which is used as thetotal breath count.

Step 2704 then asks whether a backup mode has been indicated asdiscussed further hereinbelow. If no, step 2706 calculates a value foraverage breath as illustrated. With this step, patient breathing rate istracked. If the answer in step 2704 is yes, the average breath rate isset as equal to the previous average breath in step 2708.

After steps 2706 or 2708, step 2710 calculates the average breath volumeaccording to the formula shown. Step 2712 then determines the maximumexhalation duration and step 2714 determines a value representative ofthe pneumatic leaks occurring during inhalation. Steps 2710-2714 usevalues for these calculations which are explained further hereinbelow.

Step 2716 then asks whether the current peak blower inlet valve (BIV)position is less than 100. If yes, step 2718 decrements the blowerspeed. In other words, if the blower is supplying excessive air, theblower speed is decreased. If the answer is step 2716 is no or afterstep 2718, step 2720 asks whether the current peak BIV position isgreater than 130. The difference between 130 in this step and 100 instep 2716 provides a dead zone so that the program does not continuouslyhunt for a stable value. If the answer in step 2720 is yes, step 2722asks whether the current blower speed is below the maximum speed. Ifyes, step 2724 increments the blower speed in order to supply more air.

After step 2724 or if the answers in steps 2720 or 2722 are no, step2726 then sets the pressure control set point to the exhale prescriptionpressure and step 2728 then opens exhalation valve 73 by activatingexhalation solenoid 72. The phase control flags are then reset in step2730 and the peak BIV position variable flag is cleared in step 2732.Next, step 2734 clears the blanking interval counter and the programreturns to step 2408 (FIG. 24).

FIGS. 28-30 illustrate the three selectable backup modes which areexecuted if inhalation is not detected within a time limit based onbreath rate. In the CPAP mode (FIG. 28), the pressure is increased to aconstant value and maintained. In the BPM backup mode (FIG. 29), thepatient pressure is increased to a high level and maintained until theearliest occurrence of sensed exhalation or a time correlated withprevious breath rates. The patient backup mode (FIG. 30) results in ahigh pressure being delivered to the patient for a fixed time not basedon previous breath rates, or when exhalation is sensed, whichever occursfirst.

Turning first to FIG. 28, CPAP BACKUP module 2800 enters at step 2802which asks whether the backup test is true. More particular, this stepasks whether the pressure control mode is set for exhale, the backupflag is clear, and the count on the exhale timer is greater than theaverage of the last three exhale periods plus five seconds. If all ofthese condition are true, then the answer in step 2802 is yes. Theprogram then moves to step 2804 which sets the pressure control mode toinhale and then in step 2806 sets the backup flag as true.

If any of the required conditions for step 2802 is not satisfied, thenthe answer in step 2802 is no and the program moves to step 2808 whichasks whether the backup flag is set. If yes, step 2810 asks whether thecount on the backup timer is greater than the minimum allowables timewhich in this step is the average of the last three inhalation periods(see steps 2706 and 2708). If the answer in step 2810 is yes, step 2812clears the backup flag. After steps 2806 or 2812, or if the answers insteps 2808 or 2810 are no, the program returns to step 2408 (FIG. 24).

BPM BACKUP module 2900 (FIG. 29) enters at step 2902 which asks whetherthe backup flag is clear. If yes, step 2904 asks whether the inhaletimer count is greater than or equal to the maximum allowable inhalationtime which is 60 divided by the BPM dial setting and this quantity timesthe fixed inhalation to exhalation ratio (typically 1:1.5). If yes, step2905 sets the pressure control mode to exhale and step 2908 sets thebackup flag as true.

If the answer in step 2902 is no, step 2910 asks whether the count onthe backup timer is greater than or equal to the minimal allowable timewhich is the same value as that determined in step 2904. If yes, step2912 clears the backup flag.

If the answer in step 2904 is no, step 2914 asks whether the exhaletimer count is greater than or equal to the maximal allowable exhalationtime which is 60 divided by the BPM setting quantity divided by theinhalation/exhalation ration. If yes, step 2916 sets the pressurecontrol mode to inhale as step 2918 sets the backup flag as true. Aftersteps 2908, 2912 or 2918, or if the answers in steps 2910 or 2914 areno, the program returns to step 2408 (FIG. 24).

FIG. 30 illustrates PATIENT BACKUP module 3000 which enters at step3002. This step asks whether the backup flag is clear and if yes, theprogram moves to step 3004 which asks whether the inhale timer count isgreater than or equal to the time duration of the last inhalation. Ifyes, step 3006 sets the pressure control mode to exhale and step 3008sets the backup flag as true.

If the answer in step 3002 is no, step 3010 asks whether the count onthe backup timer is greater than or equal to the minimal allowable timewhich is the last inhalation time as determined by the inhalationcounter (see step 3158). If yes, step 3012 clears the backup flag.

If the answer in step 3004 is no, step 3014 asks whether the exhaletimer count is greater than or equal to the time duration of the lastexhale. If yes, step 3016 sets the pressure control mode to inhale andstep 3018 then sets the backup flag as true. After steps 3008, 3012 or3018, or if the answers in step 3010 or 3014 are no, the program returnsto step 2408 (FIG. 24).

FIGS. 31A-B illustrate A/D INTERRUPT module 3100 which is executed every14 milliseconds . This module enters at step 3102 which asks whether thelast conversion was executed for pressure or flow. If pressure, step3104 retrieves the A/D value for pressure sensor 38 which value waspreviously stored during the last conversion for pressure. Step 3106then initiates A/D conversion for flow sensor 76 and the interrupt ends.

If the last conversion was for flow as determined in step 3102, step3108 then retrieves the previously stored flow sensor value. This valueis then linearized according to look-up table values stored in memorywhich are empirically developed for the particular patient pneumatichose 26 being used. In practice, units include standard hose links sothat the look-up table values do not need to be redeveloped.

Step 3112 then determines the pressure drop in patient hose 26 on thebasis of linear flow according to techniques well known to those skilledin the art. The pressure deviation from the prescription set point isthen determined in step 3114. This deviation is the pressure error (Pe)determined by subtracting the presure drop which is the pressure at thepatient's nose (Pn) less the pressure drop in the hose at the flow rate(Pdrop) quantity subtracted from the prescription set point.

Step 3116 then asks whether the pressure error is greater than 2. Ifyes, step 3118 opens the blower inlet valve 46 one position. If theanswer to step 3116 is no, step 3120 asks whether the pressure error isless than -2. If yes, step 3122 closes blower inlet valve 46 oneposition. The span between +2 in step 3116 and -2 in step 3120 providesa dead zone to prevent hunting for a stable position.

After steps 3118 or 3122, or if the answer in step 3120 is no, theprogram moves to step 3124 which increments the variable "volume sum"with the current flow value. In this way, the total volume delivered tothe patient is determined by adding the sum of periodically storedinstantaneous flows delivered to the patient. These values aredetermined at equal time intervals and in this way to total volumedelivered equals the sum of the flow values.

                  APPENDIX I                                                      ______________________________________                                        ACTION TABLE                                                                  ______________________________________                                        Sounds State Transition Matrix                                                To: (new)    0      1     2    3   4    5   6     7                                 Hi               0    0   0    0   1    1   1    1                      From:       Med        0    0   1    1   0    0   1    1                      (old)       Low    0   1    0   1    0   1    0   1                           ______________________________________                                        0     0     0      0    0    1   2    3   4    5   6    7                     1     0     0      1    8    9  10   11  12   13  14   15                     2     0     1      0   16   17  18   19  20   21  22   23                     3     0     1      1   24   25  26   27  28   29  30   31                     4     1     0      0   32   33  34   35  36   37  38   39                     5     1     0      1   40    4  42   43  44   45  46   47                     6     1     1      0   48   49  50   51  52   53  54   55                     7     1     1      1   56   57  58   59  60   61  62   63                     ______________________________________                                        State   Description of Comments                                               0       No Sound                                                              1       Smooth Snoring     [ssnore]                                           2       Other (talking)    [other]                                            3       Turbulent Snoring  [tsnore]                                           4       Start of clearing an obstruction                                                                 [sclob]                                            5       Partial obstruction                                                                              [parob]                                            6       Clearing an obstruction                                                                          [clob]                                             7       Raucous Snoring    [rsnore]                                           Transition                                                                            Action   Comments                                                     0       Decrease No sounds                                                    151     Increase Start of ssnore                                              2       None     Start of other                                               3       Increase Start of tsnore                                              4       Increase Start of sclob                                               205     Increase Start of parob                                               6       Increase Start of clob                                                7       Increase Start of rsnore                                              8       None     End of ssnore                                                259     Increase Ssnore continues                                             10      None     End of ssnore                                                11      Increase Ssnore to tsnore-airway narrowing?                           12      Increase Airway narrowing?                                            13      Increase Airway narrowing?                                            14      Increase Airway narrowing?                                            15      Increase Airway narrowing?                                            16      None     End of other                                                 17      Increase Airway opening?                                              18      None     Other                                                        19      Increase Probable tsnore cont.                                        20      Increase Clob                                                         21      Increase Clob                                                         22      Increase Clob                                                         23      Increase Rsnore                                                       24      None     End of tsnore                                                25      Increase Tsnore to ssnore                                             26      Increase Airway narrowing? Airflow decreasing?                        27      Increase Tsnore                                                       28      Increase Airway narrowing? Airflow increasing?                        29      Increase Airway narrowing? Airflow decreasing?                        30      Increase Airway narrowing? Airflow decreasing?                        31      Increase Airway narrowing? Airflow increasing?                        32      None                                                                  33      Increase Airway opening post obstruction                              34      Increase Airway opening post obstruction                              35      Increase Airway opening post obstruction                              36      None                                                                  37      Increase                                                              38      Increase                                                              39      Increase Airway opening post obstruction                              40      None                                                                  41      Increase                                                              42      Increase                                                              43      Increase Airway opening post obstruction                              44      Increase                                                              45      Increase Partially obstructed snore                                   46      Increase                                                              47      Increase Airway opening post obstruction                              48      None                                                                  49      Increase Airway opening post obstruction                              50      Increase Airway opening post obstruction                              51      Increase Airway opening Airflow decreasing                            52      Increase Airflow increasing                                           53      Increase                                                              54      Increase                                                              55      Increase Airway opening post obstruction                              56      None                                                                  57      Increase Airway opening                                               58      Increase Airflow decreasing                                           59      Increase Airway opening                                               60      Increase Airway narrowing? Airflow increasing?                        61      Increase                                                              62      Increase                                                              63      Increase                                                               3126 then increments the backup timer counter by one. Next, step 3128     increments the sample counter and blanking interval counter each by one.     Step 3130 then asks whether the backup flag is set. If yes, step 3132     increments the backup timer by one.

If the answer in step 3130 is no, step 3134 (FIG. 31B) asks whether theblanking interval counter is greater than its predetermined allowablelimit (preferably 1.4 seconds which is 100 counts of the interruptreturn every 0.014 seconds). If the answer in step 3134 is yes, step3136 then asks whether the pressure control mode is set to exhale. Ifyes, step 3138 then asks whether the current flow value is greater thanor equal to the exhale flow bias (the predetermined amount of air lostthrough the vent) plus the amount of leakage occuring during inhalation.

If the answer in step 3138 is yes, step 3140 sets the Prx which is thecontrol mode to inhale. Step 3142 then clears the blank intervalcounter, step 3144 saves the current sample count and step 3146 clearsthe sample counter.

If the answer in step 3136 is no, step 3148 asks whether the pressurecontrol mode is set to inhale. If yes, step 3150 asks whether thecurrent flow is less than or equal to the vent flow bias during inhaleplus the leakage during exhale. If this condition is true, step 3152sets the Prx control mode flag for exhale. Step 3154 then clears theblank interval counter after which step 3155 clears the volume sumcounter and step 3156 saves the current value for volume sum. Step 3156then resets the variable volume sum to zero, step 3158 saves the currentsample count, and step 3160 clears the sample counter.

If the answers are no in steps 3130, 3134-3138 or 3148-3150, or aftersteps 3146 or 3160, the program moves to step 3162 which initiates anA/D conversion for the pressure transducer. A/D INTERRUPT module 3100then ends. t,0450

We claim:
 1. An apparatus for determining the airway patency of apatient exhibiting a breath cycle having inhalation and exhalationphases, said apparatus comprising:means for supplying a breathable gasfrom a source thereof under a controllable pressure to at least aportion of the patient's airway; means for sensing patient respirationflow and pressure and for producing signals representative ofsubstantially simultaneous flow and pressure; signal processing meansfor receiving said signals and responsive thereto for determining thepatient's respiratory admittance from said substantially simultaneousflow and pressure; and means for controlling said pressure in accordancewith said admittance, said signal processing means including means fordetermining said admittance as the dividend of flow divided by pressure.2. The apparatus as set forth in claim 1, said breathable gas includingambient air.
 3. The apparatus as set forth in claim 1, said sensingmeans including flow sensor means for sensing patient respiration flowand for producing signals representative thereof.
 4. The apparatus asset forth in claim 3, said flow sensor means including a differentialpressure flow sensor.
 5. The apparatus as set forth in claim 1, saidsensing means including pressure sensing means for sensing a pressure ofbreathable gas delivered to the patient.
 6. The apparatus as set forthin claim 1, said signal processing means includingmeans for storing atleast one admittance template composed of a plurality of admittances inmemory, means for storing a set of patient admittances, and means forcomparing said admittance set with said at least one stored admittancetemplate.
 7. The apparatus as set forth in claim 6, said storing meansincluding a plurality of stored templates, said controlling meansincluding means for determining which of said templates presents theclosest match with said admittance set, said closest match beingrepresentative of patient airway patency.
 8. the apparatus as set forthin claim 7, said controlling means including means for controlling saidpressure in accordance with said closest match.
 9. The apparatus as setforth in claim 7, said templates presenting normalized amplitudes andtime bases, said controlling means including means for normalizing theamplitude and time base of said respiratory admittance in accordancewith said stored templates.
 10. The apparatus as set forth in claim 7,said controlling means including memory means for storing pressurechange data in association with each of said templates, said controllingmeans including means for controlling said breathable gas pressure inaccordance with pressure change data associated with said closest match.11. The apparatus as set forth in claim 7, said controlling meansincluding a microprocessor.
 12. The apparatus as set forth in claim 1,said admittance being determined as a function of said flow and pressureduring patient inhalation.
 13. The apparatus as set forth in claim 1,said controlling means including a microprocessor.
 14. The apparatus asset forth in claim 1, said signal processing means including means forusing Fast Fourier Transforms for processing data representative of saidflow and pressure.
 15. A method of determining the airway patency of apatient, the patient exhibiting a breath cycle having inhalation andexhalation phases, said method comprising:using sensing means forrepeatedly sensing a plurality of substantially simultaneous patientrespiration flows and pressures during a patient inhalation phase andfor producing signals representative thereof; using signal processingmeans for receiving said signals and responding thereto for determininga set of patient admittances from said flows and pressures and storingadmittance data representative of said admittance set in a memorydevice, and using said signal processing means for determining saidadmittances as the dividend of flow divided by pressure; comparing insaid signal processing means said admittance data with predeterminedadmittance templates stored in said memory device; and determining insaid signal processing means the closest match of said admittancetemplates with said admittance data, said closest match beingrepresentative of patient airway patency during said phase.
 16. Themethod as set forth in claim 15, said step of determining admittancedata including the step of using Fast Fourier Transforms for processingdata representative of said flow and pressure.
 17. The method as setforth in claim 15 further including the steps ofsupplying the patientwith a breathable gas from a source thereof under a controllablepressure to at least a portion of the patient's airway; and controllingsaid gas pressure in accordance with said patient airway patency. 18.The method as set forth in claim 15, further including the stepsofstoring in a memory device a set of pressure change actionscorresponding to said templates, and executing an action correspondingto said template presenting the closest match to said admittance data.19. An apparatus for determining the airway patency of a patientcomprising:means for repeatedly sensing a plurality of substantiallysimultaneous patient respiration flows and pressures and for producingsignals representative thereof; signal processing means for receivingsaid signals and responsive thereto for determining a set of respiratoryadmittances from said flows and pressure, said signal processing meansincluding means for determining each of said admittances as the dividendof flow divided by pressure; and memory means for storing a plurality ofairway admittance templates representative of a plurality ofpredetermined airway admittances correlated with airway patency, saidsignal processing means including means for determining which of saidtemplates presents the closest matching admittance to said admittanceset, the airway patency correlated with said matching admittance beingrepresentative of the patient's airway patency.